﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Petaframe.Configuration
{
    public class DataAccessConfigReader : ConfigReaderBase
    {
        public DataAccessConfigReader()
        {

        }
        public DataAccessConfigReader(string pysicalConfigFilePath)
            : base(pysicalConfigFilePath)
        {
            
        }
         
        public override IDictionary<string, IEnumerable<System.Xml.Linq.XElement>> ReadConfig()
        {
            var data = xdoc.Root.Element("Petaframe.DataAccess");
            if(data !=null)
            {
                var processlog = new List<XElement>(data.Descendants("processlog"));

                if (processlog.Count() > 0)
                {
                    configElements.Add("processlog", processlog);
                }
            }
            
            return configElements;
        }
    }
}
